#ifndef __DAHUA_MULTICAMERAS_DEMO_MVDISPLAY_HELPER_H__
#define __DAHUA_MULTICAMERAS_DEMO_MVDISPLAY_HELPER_H__

#include "MvImageConvertHelper.h"
#include "Infra/Thread.h"
#include "Memory/SharedPtr.h"
#include "MvRender.h"

namespace Dahua{

class CMvDisplayHelper
{
public:
	CMvDisplayHelper(const GenICam::ICameraPtr& sptrCamera);
	~CMvDisplayHelper();

public:
	static unsigned int __stdcall threadProc(void* pParam);

public:
	bool isValid();

	bool startDisplay(void* pHandle, int iDispalyRate);

	bool stopDisplay();

private:
    void destroyThread();

	void displayThreadProc(Infra::CThreadLite*);

private:
	CMvImageConvertHelperPtr		m_sptrImageConvertHelper;
//	Infra::CThreadLite				m_displayThread;
	bool							m_bRunning;
	CRender							m_render;
	uint32_t						m_iWidth;
	uint32_t						m_iHeight;

    HANDLE                          m_hThread;
};

typedef Memory::TSharedPtr<CMvDisplayHelper> CMvDisplayHelperPtr;

} // namespace Dahua

#endif // __DAHUA_MULTICAMERAS_DEMO_MVDISPLAY_HELPER_H__
